using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using System.Web.Http;
using WLYT.Admin.WebApi.Models;
using WLYT.Application.Interfaces;
using WLYT.Domain.Model;

namespace WLYT.Admin.WebApi.Controllers
{
    [System.Web.Http.Description.ApiExplorerSettings(IgnoreApi = true)]
    public class InventoryLogController : BaseController
    {
        private readonly IInventoryLogService InventoryLogService;

        public InventoryLogController(IInventoryLogService inventoryLogService)
        {
            InventoryLogService = inventoryLogService;
        }

        [HttpGet]
        [Route("api/InventoryLog/GetData")]
        public async Task<Table<InventoryLog>> GetData(string itemCode, string labelId, string itemDesc, string docNum, string location, string type, int pageSize, int pageIndex)
        {
            var response = await InventoryLogService.GetModelsByPageAsync(itemCode, labelId, itemDesc, docNum, location, type, pageSize, pageIndex);
            return new Table<InventoryLog>(response.Item1, response.Item2);
        }
    }
}